import { IColumn, Column } from '../core'
export const UpdateDate = (options: IColumn = {}) => {
    options.label = options.label || options.comment || '更新时间'
    options.placeholder = options.placeholder || `请选择${options.label}`
    return Column({ hideInTable: true, valueType: 'dateTime', hideInEdit: true, hideInCreate: true, ...options })
}
export const DeleteDate = (options: IColumn = {}) => {
    options.label = options.label || options.comment || '删除时间'
    options.placeholder = options.placeholder || `请选择${options.label}`
    return Column({ hideInTable: true, valueType: 'dateTime', hideInEdit: true, hideInCreate: true, ...options })
}
export const CreateDate = (options: IColumn = {}) => {
    options.label = options.label || options.comment || '创建时间'
    options.placeholder = options.placeholder || `请选择${options.label}`
    return Column({ valueType: 'dateTime', sorter: true, hideInEdit: true, hideInCreate: true, ...options })
}
export const DateTime = (options: IColumn = {}) => {
    options.label = options.label || options.comment || '时间'
    options.placeholder = options.placeholder || `请选择${options.label}`
    return Column({ type: 'timestamp without time zone', valueType: 'dateTime', sorter: true, ...options })
}

export const Day = (options: IColumn = {}) => {
    return Column({
        valueType: 'digit',
        ...options
    })
}
export const Uuid = (options: IColumn = {}) => {
    return Column({
        ...options
    })
}
export const PrimaryUuid = (options: IColumn = {}) => {
    options.label = options.label || '编号'
    options.placeholder = options.placeholder || `请输入${options.label}`
    return Column({ primary: true, hideInTable: true, hideInCreate: true, hideInEdit: true, ...options })
}

export const PrimaryKey = (options: IColumn = {}) => {
    return Column({
        primary: true,
        primaryType: 'String',
        ...options
    })
}


